//------------------------------------------------------------------------------
#include <QtDebug>
#include "CPrintFrm.h"
//------------------------------------------------------------------------------
CPrintFrm *CPrintFrm::instance=NULL;
//------------------------------------------------------------------------------
CPrintFrm * CPrintFrm::getInstance(void) {
	if(instance == NULL) {
		instance=new CPrintFrm();
	}
	return instance;
}
//------------------------------------------------------------------------------
void CPrintFrm::print(CRequest *request, QWidget *parent) {
	if(exec() == QDialog::Accepted) {
		CPrintPreviewFrm::EPrintType printType=CPrintPreviewFrm::eptScreen;
		
		if(rdFile->isChecked()) printType=CPrintPreviewFrm::eptFile;
		if(rdPrinter->isChecked()) printType=CPrintPreviewFrm::eptPrinter;
		
		CPrintPreviewFrm::getInstance()->print(request, printType, parent);
	}
}
//------------------------------------------------------------------------------
void CPrintFrm::print(CRequest *request, CPrintPreviewFrm::EPrintType printType, QWidget *parent) {
	CPrintPreviewFrm::getInstance()->print(request, printType, parent);
}
//------------------------------------------------------------------------------
CPrintFrm::CPrintFrm() : QDialog() {
	setupUi(this);
}
//------------------------------------------------------------------------------


